<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../lib/vue.js"></script>
</head>
<body>

<div id="box">
    <my-app></my-app>
</div>


<template id="temp">
    <!--模板组件中的内容必须在一个跟元素下面-->
    <div>
        <h3>{{msg}}</h3>
        <ul>
            <li v-for="item in arr">
                {{item}}
            </li>
        </ul>
    </div>
</template>

<script>

    var vm = new Vue({
        el: '#box',
        components: {
            'my-app': {
                template: '#temp',
                data: function () {
                    return {
                        msg: 'nihao',
                        arr: ['a','b','c']
                    }
                }
            }
        }

    })
</script>
</body>
</html>